import Foundation

/// 账单类型
enum BillType: String, Codable, CaseIterable {
    case income = "收入"
    case expense = "支出"
}

/// 账单分类
enum BillCategory: String, Codable, CaseIterable {
    case food = "餐饮"
    case transport = "交通"
    case shopping = "购物"
    case salary = "工资"
    case other = "其他"
}

/// 账单数据模型
struct Bill: Identifiable, Codable {
    var id = UUID()                // 唯一标识
    var amount: Double             // 金额
    var type: BillType             // 收入/支出
    var category: BillCategory     // 分类
    var remark: String             // 备注
    var date: Date                 // 时间
    
    init(id: UUID = UUID(), amount: Double, type: BillType, category: BillCategory, remark: String = "", date: Date = Date()) {
        self.id = id
        self.amount = amount
        self.type = type
        self.category = category
        self.remark = remark
        self.date = date
    }
}
